package com.weipai.springboot.model.api;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.solr.client.solrj.beans.Field;
import org.springframework.data.solr.core.mapping.Dynamic;
import org.springframework.data.solr.core.mapping.SolrDocument;
import org.springframework.data.solr.repository.Facet;

import java.util.HashMap;
import java.util.Map;

/**
 * 商品信息
 *
 * @author songmengqiang
 * @create 2018-09-05 11:16
 **/
@SolrDocument
public class GoodsItem {

    @Field
    private String id; //商品id
    @Field
    private String categoryId; //分类id
    @Field
    private String categoryName; //分类名称

    @Field
    private String brandId; //品牌id
    @Field
    private String brandName; //品牌名称

    @Field
    private String shopId; //店铺id
    @Field
    private String shopName; //店铺名称
    @Field
    private String shopProvince; //店铺省份
    @Field
    private String shopCity; //店铺城市
    @Field
    private String shopCounty; //县/区
    @Field
    private String shopAddress; //详细地址
    @Field
    private String productId; //产品id
    @Field
    private String productName; //产品名称
    @Field
    private String spuNumber; //货品编号
    @Field
    private Integer isBoutique; //是否是精品
    @Field
    private Integer isNews; //是否是新品
    @Field
    private Integer isPackage; //是否包邮
    @Field
    private String createTime; //创建时间
    @Field
    private Integer productStatus; //产品状态
    @Field
    private Integer productDel; //是否删除
    @Field
    private String productImg; //轮播图第一张图片

    @Field
    private String sellingPoints; //这是卖点
    @Field
    private Integer soldOutGoods; //产品销售数量
    @Field
    private String path; //   产品分类 路径
    @Field
    private String productCategoryImg; //产品分类图片

    @Field
    private String skuNumber; //商品编号
    @Field
    private String goodsName; //商品名称
    @Field
    private Integer goodsStatus; //商品状态
    @Field
    private Integer goodsDel; //商品是否删除
    @Field
    private Integer originalPrice; //原价
    @Field
    private Integer currentPrice; //现价
    @Field
    private Integer minPrice; //最小价


    //封装规格选项搜索对应属性字段
    @Dynamic
    @Field("*_prop")
    @JsonIgnore
    private Map<String, String> propMap = new HashMap<String, String>();


    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getProductCategoryImg() {
        return productCategoryImg;
    }

    public void setProductCategoryImg(String productCategoryImg) {
        this.productCategoryImg = productCategoryImg;
    }

    public void putProp(String key, String value) {
        propMap.put(key, value);
    }

    public String getSellingPoints() {
        return sellingPoints;
    }

    public void setSellingPoints(String sellingPoints) {
        this.sellingPoints = sellingPoints;
    }

    public Integer getSoldOutGoods() {
        return soldOutGoods;
    }

    public void setSoldOutGoods(Integer soldOutGoods) {
        this.soldOutGoods = soldOutGoods;
    }

    public Map<String, String> getPropMap() {
        return propMap;
    }

    public void setPropMap(Map<String, String> propMap) {
        this.propMap = propMap;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getBrandId() {
        return brandId;
    }

    public void setBrandId(String brandId) {
        this.brandId = brandId;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopProvince() {
        return shopProvince;
    }

    public void setShopProvince(String shopProvince) {
        this.shopProvince = shopProvince;
    }

    public String getShopCity() {
        return shopCity;
    }

    public void setShopCity(String shopCity) {
        this.shopCity = shopCity;
    }

    public String getShopCounty() {
        return shopCounty;
    }

    public void setShopCounty(String shopCounty) {
        this.shopCounty = shopCounty;
    }

    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getSpuNumber() {
        return spuNumber;
    }

    public void setSpuNumber(String spuNumber) {
        this.spuNumber = spuNumber;
    }

    public Integer getIsBoutique() {
        return isBoutique;
    }

    public void setIsBoutique(Integer isBoutique) {
        this.isBoutique = isBoutique;
    }

    public Integer getIsNews() {
        return isNews;
    }

    public void setIsNews(Integer isNews) {
        this.isNews = isNews;
    }

    public Integer getIsPackage() {
        return isPackage;
    }

    public void setIsPackage(Integer isPackage) {
        this.isPackage = isPackage;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Integer getProductStatus() {
        return productStatus;
    }

    public void setProductStatus(Integer productStatus) {
        this.productStatus = productStatus;
    }

    public Integer getProductDel() {
        return productDel;
    }

    public void setProductDel(Integer productDel) {
        this.productDel = productDel;
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }

    public String getSkuNumber() {
        return skuNumber;
    }

    public void setSkuNumber(String skuNumber) {
        this.skuNumber = skuNumber;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Integer getGoodsStatus() {
        return goodsStatus;
    }

    public void setGoodsStatus(Integer goodsStatus) {
        this.goodsStatus = goodsStatus;
    }

    public Integer getGoodsDel() {
        return goodsDel;
    }

    public void setGoodsDel(Integer goodsDel) {
        this.goodsDel = goodsDel;
    }

    public Integer getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(Integer originalPrice) {
        this.originalPrice = originalPrice;
    }

    public Integer getCurrentPrice() {
        return currentPrice;
    }

    public void setCurrentPrice(Integer currentPrice) {
        this.currentPrice = currentPrice;
    }

    public Integer getMinPrice() {
        return minPrice;
    }

    public void setMinPrice(Integer minPrice) {
        this.minPrice = minPrice;
    }

    @Override
    public String toString() {
        return "GoodsItem{" +
                "id='" + id + '\'' +
                ", categoryId='" + categoryId + '\'' +
                ", categoryName='" + categoryName + '\'' +
                ", brandId='" + brandId + '\'' +
                ", brandName='" + brandName + '\'' +
                ", shopId='" + shopId + '\'' +
                ", shopName='" + shopName + '\'' +
                ", shopProvince='" + shopProvince + '\'' +
                ", shopCity='" + shopCity + '\'' +
                ", shopCounty='" + shopCounty + '\'' +
                ", shopAddress='" + shopAddress + '\'' +
                ", productId='" + productId + '\'' +
                ", productName='" + productName + '\'' +
                ", spuNumber='" + spuNumber + '\'' +
                ", isBoutique=" + isBoutique +
                ", isNews=" + isNews +
                ", soldOutGoods=" + soldOutGoods +
                ", isPackage=" + isPackage +
                ", createTime='" + createTime + '\'' +
                ", productStatus=" + productStatus +
                ", productDel=" + productDel +
                ", productImg='" + productImg + '\'' +
                ", sellingPoints='" + sellingPoints + '\'' +
                ", skuNumber='" + skuNumber + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", productCategoryImg='" + productCategoryImg + '\'' +
                ", path='" + path + '\'' +
                ", goodsStatus=" + goodsStatus +
                ", goodsDel=" + goodsDel +
                ", originalPrice=" + originalPrice +
                ", currentPrice=" + currentPrice + '\'' +
                ", minPrice=" + minPrice + '\'' +
                '}';
    }
}
